package cn.com.lms.business.exam.enums;

/**
 * 快捷分数 设置类型 1-按照题型设置  2-按照总分100自动平摊
 */
public enum QuickScoreTypeEnum {
    SET_BY_SUBJECT("按照题型设置",Short.valueOf("1")),
    AUTOMATIC_SPLIT("按照总分100自动平摊",Short.valueOf("2"));
    private String name;//名称

    private Short value;//值

    /**
     * 通过type获取Msg
     *
     * @param type
     * @return
     * @Description:
     */
    public static String getEnumMsgByType(String type) {
        for (QuickScoreTypeEnum e : QuickScoreTypeEnum.values()) {
            if (e.toString().equals(type)) {
                return e.name;
            }
        }
        return "";
    }

    public static Short getEnumValueByType(String type) {
        for (QuickScoreTypeEnum e : QuickScoreTypeEnum.values()) {
            if (e.toString().equals(type)) {
                return e.value;
            }
        }
        return 0;
    }
    private QuickScoreTypeEnum(String name, Short value) {
        this.name = name;
        this.value = value;
    }


    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }

    public Short getValue() {
        return value;
    }
    public void setValue(Short value) {
        this.value = value;
    }
}
